<%--
 *  File:   OutBatchNumAndPasswordSelect.jsp
 *  Desc:	
 *
 *  Date	  :	 2011/8/29  		    
 *  Author	:  JackYin	 
 *
 *  Copyright (C) 2000 - 2008 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%@ page import="java.text.*" %>
<%
  //init param
  String privilegeCode = "A0903";
  String strTableName = "v_outbunchpasswordsearch";
  String strModuleName = "TDR";
  String contextPath = request.getContextPath(); 

%>
<%@ include file="/inc/CommonHeader.inc" %>
<%@ include file="/inc/OvalLocationDefault.inc" %>
	
<html>
<head>
<title>OutBatchNumAndPasswordSelect</title>
<PageFlow:CheckPageFlow pageName="p_outbunchpasswordsearchnew"/>
<%@ include file="/inc/SumDiv.inc" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/SummaryDivision.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/Calendar.js"></script>
<%@ include file ="/inc/NewCalendar.inc" %>
<script language="JavaScript">
<%--  put your custom script here   --%>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "OutBatchNumAndPasswordSelectnew.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}
function clickRow(obj,idx)
{
  var cform = document.cform;
  cform.deliveryid.value = obj;
}

</script>
</head>

<body style="overflow: auto;">
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
    <input type="hidden" name="pagename" value="p_outbunchpasswordsearchnew">
    <input type="hidden" name="actionname">
    

<%--  page location   --%>
    <%@ include file="/inc/PageLocation.inc" %>

    <table width="100%" cellspacing="0" border="0" cellpadding="0">
      <tr>
<%--  search criteria  --%>
      </tr>
      <tr>
        <td>
          
          <table width="100%" border="0" cellspacing="0">
            <tr>
				<td class="summary_top" width="10%" colspan="3"></td>
			</tr>
			<%@ include file="/inc/SummarySearch.inc"%>
			
          </table>
        </td>
      </tr>
         <table width="35%" border="0" cellspacing="0">
          <tr>
			 <%
                SimpleDateFormat formatter1 = new SimpleDateFormat ("yyyy-MM-dd");
                String str_date_end=formatter1.format(new Date());
                Date d = (Date)pageContext.getAttribute("enddate");
				if(d != null)str_date_end=formatter1.format(d);
              %>

	      <td><%= label.getLabelName("L_TimePeriod") + label.getLabelName("L_Colon") %></td>
	           <td>
                <custom:text property="startdate"  dataType="date"  module="IMG" size="15" />
              <a onclick="javascript:c.show(this,'cform.startdate','yyyy-MM-dd');"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
              --
              <custom:text property="enddate"  dataType="date" dataFormatName="dateformat"  module="IMG"  size="15" value="<%=str_date_end %>"/>
              <a onclick="javascript:c.show(this,'cform.enddate','yyyy-MM-dd');"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
            &nbsp;&nbsp;&nbsp;<a href="javascript:page_summary('search')"><img src="<%= contextPath %>/images/<%= strLanguageCode %>/go_fy.gif" border="0" style="border: 1 solid #000000"></a>
            </td>
			</tr>
         </table>
      <tr>
        <td>
          <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
			<tr  class="deepblue-left"> 
	            <td width="4%" class="title_center">&nbsp;</td>
	            <td width="10%" class="title_center"><a href="javascript:page_summary('orderby','orgcode')"><%= label.getLabelName("L_InfoUnitCode") %></a></td>
	            <td width="10%" class="title_center"><a href="javascript:page_summary('orderby','orgname')"><%= label.getLabelName("L_InfoUnitName") %></a></td>
	            <td width="10%" class="title_center"><a href="javascript:page_summary('orderby','itemcode')"><%= label.getLabelName("L_ProdCode") %></a></td>
	            <td width="10%" class="title_center"><a href="javascript:page_summary('orderby','itemname')"><%= label.getLabelName("L_ProductName") %></a></td>
	            <td width="10%" class="title_center"><a href="javascript:page_summary('orderby','qty')"><%= label.getLabelName("L_Qty") %></a></td>
	          <td width="10%" class="title_center"><a href="javascript:page_summary('orderby','actdate')"><%= label.getLabelName("L_Time") %></a></td>
	           <td width="10%" class="title_center"><a href="javascript:page_summary('orderby','datacode')"><%= label.getLabelName("L_SuperviseCode") %></a></td>
	        
	         </tr>
	         <%
             int j = 0;
             String strClassType = new String(); 
             Integer nDefaultPeriodId = new Integer(-1);  
             boolean bHasChecked = false;
             Vector searchresults = (Vector)pageContext.getAttribute("searchresults");
             if(searchresults == null) searchresults = new Vector();
             int nDefaultdeliveryid = -1;
             
             //4reload the checked period
         
          %>
          <logic:iterate id="summary" collection="<%= searchresults %>">                      
         <%
            HashMap summaryMap = (HashMap)pageContext.getAttribute("summary");
            if(summaryMap == null) summaryMap = new HashMap();
            String strIsChecked = "";
            if(j%2 == 1){
              strClassType = "td-listrom";             
            }else{                    
              strClassType = "";
            }
            
            if(j == 0){
            	strIsChecked = "Checked"; 
            	if(summaryMap.get("deliveryid") != null){
            		nDefaultdeliveryid = ((Integer)summaryMap.get("deliveryid")).intValue();
            	}
            	
            }
            
	              
            j++;     
          %>
           <tr onmouseover="this.className='tr-over'" onmouseout="this.className='<%=JspHelper.filterNull(strClassType)%>'"  onClick="javascript:radiotrue('radio<%=JspHelper.filterNull(j)%>');clickRow('<custom:write property="deliveryid" name="summary"/>','<%=j + "" %>')" class="<%=JspHelper.filterNull(strClassType)%>">
            <td>
              <input class="normalradio" id="radio<%=JspHelper.filterNull(j )%>" type="radio" name="deliveryidradio" value="<custom:write property="deliveryid" name="summary"/>" <%=JspHelper.filterNull( strIsChecked)%>>
            </td>
           <!-- 
            <td>&nbsp;<A onclick="page_info('<custom:write property="deliveryid" name="summary"/>')"><custom:write property="customid" name="summary"/></A></td>
            -->
            <td>&nbsp;<custom:write property="orgcode" name="summary"/></td>
            <td>&nbsp;<custom:write property="orgname" name="summary" /></td>
            <td>&nbsp;<custom:write property="itemcode" name="summary"/></td>
            <td>&nbsp;<custom:write property="itemname" name="summary"/></td>
             <td>&nbsp;<custom:write property="qty" name="summary" /></td>
            <td>&nbsp;<custom:write property="actdate" name="summary"/></td>
            <td>&nbsp;<custom:write property="datacode" name="summary"/></td>
          </tr>
          </logic:iterate>
          <%//---------------set default value-------------------- %>
          <input type="hidden" name="deliveryid" value="<%=JspHelper.filterNull( nDefaultdeliveryid )%>">
          <input type="hidden" name="rownum" value="1">
            <%@ include file="/inc/SummaryAction.inc" %>
        
          </table>
       <!-- 
       
          <table width="100%" cellspacing="0" cellpadding="0">
            <tr><td class="summary_top"></td></tr>
            <tr>
              <td class="td_center">
             
                <a onclick="page_new();"><custom:button type="1" label="L_New" imgsrc="new.gif" border="0" style="width:60"/></a>
              <%
                  if(pageContext.getAttribute("searchresults")!=null){
              %>
                <a onclick="page_edit();"><custom:button type="1" label="L_Edit" imgsrc="Modify.gif" border="0" style="width:60"/></a>
                <a onclick="page_delete();"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
              <%}%>
              </td>
            </tr>
          </table>
        -->
        </td>
      </tr>
    </table>
</form>
</body>
</html>